

<%@ page import="intercampi.Evento" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta name="layout" content="main" />
        <g:set var="entityName" value="${message(code: 'evento.label', default: 'Evento')}" />
        <title><g:message code="default.create.label" args="[entityName]" /></title>
    </head>
    <body>
        <div class="nav">
            <span class="menuButton"><a class="home" href="${createLink(uri: '/')}"><g:message code="default.home.label"/></a></span>
            <span class="menuButton"><g:link class="list" action="list"><g:message code="default.list.label" args="[entityName]" /></g:link></span>
        </div>
        <div class="body">
            <h1><g:message code="default.create.label" args="[entityName]" /></h1>
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
            <g:hasErrors bean="${eventoInstance}">
            <div class="errors">
                <g:renderErrors bean="${eventoInstance}" as="list" />
            </div>
            </g:hasErrors>
            <g:form action="save" >
                <div class="dialog">
                    <table>
                        <tbody>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="tipoEvento"><g:message code="evento.tipoEvento.label" default="Tipo Evento" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: eventoInstance, field: 'tipoEvento', 'errors')}">
                                    <g:select name="tipoEvento.id" from="${intercampi.TipoEvento.list()}" optionKey="id" value="${eventoInstance?.tipoEvento?.id}"  />
                                </td>
                            </tr>
                            
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="descricao"><g:message code="evento.descricao.label" default="Descricao" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: eventoInstance, field: 'descricao', 'errors')}">
                                    <g:textField name="descricao" value="${eventoInstance?.descricao}" />
                                </td>
                            </tr>
                            
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="dataEvento"><g:message code="evento.dataEvento.label" default="Data Evento" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: eventoInstance, field: 'dataEvento', 'errors')}">
                                    <g:datePicker name="dataEvento" precision="day" value="${eventoInstance?.dataEvento}"  />
                                </td>
                            </tr>
                            
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="unidadeIntercampi"><g:message code="evento.unidadeIntercampi.label" default="Unidade Intercampi" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: eventoInstance, field: 'unidadeIntercampi', 'errors')}">
                                    <g:select name="unidadeIntercampi.id" from="${intercampi.UnidadeIntercampi.list()}" optionKey="id" value="${eventoInstance?.unidadeIntercampi?.id}"  />
                                </td>
                            </tr>
                            
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="unidadeInstituicao"><g:message code="evento.unidadeInstituicao.label" default="Unidade Instituicao" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: eventoInstance, field: 'unidadeInstituicao', 'errors')}">
                                    <g:select name="unidadeInstituicao.id" from="${intercampi.UnidadeInstituicao.list()}" optionKey="id" value="${eventoInstance?.unidadeInstituicao?.id}"  />
                                </td>
                            </tr>
                            
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="alunos"><g:message code="evento.alunos.label" default="Alunos" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: eventoInstance, field: 'alunos', 'errors')}">
                                    <g:select name="alunos" from="${intercampi.Aluno.list()}" multiple="yes" optionKey="id" size="5" value="${eventoInstance?.alunos*.id}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="professores"><g:message code="evento.professores.label" default="Professores" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: eventoInstance, field: 'professores', 'errors')}">
                                    <g:select name="professores" from="${intercampi.Professor.list()}" multiple="yes" optionKey="id" size="5" value="${eventoInstance?.professores*.id}" />
                                </td>
                            </tr>
                        
                        </tbody>
                    </table>
                </div>
                <div class="buttons">
                    <span class="button"><g:submitButton name="create" class="save" value="${message(code: 'default.button.create.label', default: 'Create')}" /></span>
                </div>
            </g:form>
        </div>
    </body>
</html>
